function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = modelG.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(20, 32);
g1(1,10)=(-(params(4)*(1-params(3))));
g1(1,12)=params(1);
g1(1,16)=(-(params(3)*T(1)*(-params(13))*(1-T(1))));
g1(1,21)=(-(params(1)-params(4)*(1-params(3))));
g1(2,11)=(-((1-params(3))*(1-params(4))));
g1(2,13)=1-params(1);
g1(2,16)=(-(T(1)*params(3)*params(13)*(1-T(1))));
g1(2,21)=(-(params(3)*(1-T(1))));
g1(3,12)=(-((1-params(11))*(1-params(11)*params(9))*params(8)));
g1(3,14)=params(11);
g1(3,27)=(-(params(11)*params(9)));
g1(3,16)=(-((1-params(11))*(1-params(11)*params(9))*(-(1-T(1)))));
g1(3,21)=(-((1-params(11))*(1-params(11)*params(9))*params(7)));
g1(4,13)=(-(params(8)*(1-params(12))*(1-params(9)*params(12))));
g1(4,15)=params(12);
g1(4,28)=(-(params(9)*params(12)));
g1(4,16)=(-(T(1)*(1-params(12))*(1-params(9)*params(12))));
g1(4,21)=(-(params(7)*(1-params(12))*(1-params(9)*params(12))));
g1(5,20)=(-params(14));
g1(5,26)=params(10);
g1(6,20)=1;
g1(6,21)=params(7);
g1(6,29)=(-params(7));
g1(6,30)=(-1);
g1(7,14)=(-T(1));
g1(7,15)=(-(1-T(1)));
g1(7,26)=1;
g1(8,14)=(-params(1));
g1(8,15)=(-(1-params(1)));
g1(8,19)=1;
g1(9,12)=(-params(1));
g1(9,13)=(-(1-params(1)));
g1(9,17)=1;
g1(10,10)=(-params(4));
g1(10,11)=(-(1-params(4)));
g1(10,18)=1;
g1(11,14)=(-1);
g1(11,15)=1;
g1(11,3)=(-1);
g1(11,16)=1;
g1(12,1)=(-params(5));
g1(12,8)=1;
g1(12,31)=(-params(15));
g1(13,2)=(-params(6));
g1(13,9)=1;
g1(13,32)=(-params(16));
g1(14,8)=(-0.16);
g1(14,10)=1;
g1(15,9)=(-0.16);
g1(15,11)=1;
g1(16,7)=1;
g1(16,8)=(-1);
g1(16,9)=(-1);
g1(17,15)=1;
g1(17,5)=1;
g1(17,23)=(-1);
g1(18,14)=1;
g1(18,6)=1;
g1(18,24)=(-1);
g1(19,4)=1;
g1(19,22)=(-1);
g1(19,26)=1;
g1(20,18)=(-params(2));
g1(20,25)=1;

end
